public class Solution1759 {
    public int countHomogenous(String s) {
        long now=1,ans=0;
        for (int i=0;i<s.length();i++){
            if (i+1<s.length() && s.charAt(i)==s.charAt(i+1)){
                now++;
            }else {
                ans=(ans+now*(now+1)/2)%1000000007;
                now=1;
            }
        }
        return (int)ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1759().countHomogenous("zzzzz"));
    }
}
